﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Subject.aspx.cs" Inherits="ProjectSem40701.Admin.Subject" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
    <title>Quản lý môn</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!--
        set tab active here
     -->
    <script type="text/javascript" language="javascript">
        setTab(document.getElementById("6"));
    </script>
    <!--
        end set tab active
     -->
     <div id="box">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
            
        <h3>Quản lý môn</h3>
         <telerik:RadGrid ID="rgrSubject" runat="server" AllowFilteringByColumn="True" 
             AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
             DataSourceID="ObjectDataSource1" Skin="Default">
            <MasterTableView CellSpacing="-1" DataKeyNames="SubjectID" 
                 DataSourceID="ObjectDataSource1">
            <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>

            <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="SubjectName" HeaderText="Tên môn" 
                        SortExpression="SubjectName" UniqueName="SubjectName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="SubjectDescription" HeaderText="Mô tả" 
                        UniqueName="column">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn DataField="SubjectStatus" DataType="System.Int32" 
                        HeaderText="Trạng thái" SortExpression="SubjectStatus" 
                        UniqueName="SubjectStatus">
                        <EditItemTemplate>
                            <asp:TextBox ID="SubjectStatusTextBox" runat="server" 
                                Text='<%# Bind("SubjectStatus") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="SubjectStatusLabel" runat="server" 
                                Text='<%# Eval("SubjectStatus") %>' 
                                ondatabinding="SubjectStatusLabel_DataBinding"></asp:Label>
                        </ItemTemplate>
                        <FilterTemplate>
                            <asp:DropDownList ID="cbbStatus" runat="server" 
                                    AutoPostBack="true" OnPreRender="cbbStatus_PreRender"
                                    OnSelectedIndexChanged="cbbStatus_SelectedIndexChanged" >
                                    <asp:ListItem Text="Tất cả" Value="-1"></asp:ListItem>
                                    <asp:ListItem Text="Hoạt động" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Khóa" Value="0"></asp:ListItem>
                             </asp:DropDownList>
                        </FilterTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" UniqueName="TemplateColumn">
                        <ItemTemplate>
                            <asp:HyperLink ID="linkDetail" runat="server" 
                                NavigateUrl='<%# Eval("SubjectID", "SubjectEdit.aspx?SubjectID={0}") %>'>Xem</asp:HyperLink>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
         </telerik:RadGrid>
         
         <asp:Label ID="lblSelectedIndex" runat="server" Text="-1" Visible="False"></asp:Label>
         
         <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
             OldValuesParameterFormatString="original_{0}" 
             SelectMethod="Get_tbl_Subject_Select_All" 
             TypeName="ProjectSem40701.Admin.AdminXSD.SubjectTableAdapters.tbl_SubjectTableAdapter">
         </asp:ObjectDataSource>
     </div>
     
</asp:Content>
